/**
 * @Author: likang xie
 * @Date: 2019-11-06 17:11:52
 * @Usage 服务模块接口列表
 */

import request from "@/utils/request";

let extra = {
  showLoading: false,
};

// ---- 服务相关接口 ----

// 获取服务列表
export let listService = (params) =>
  request.get("/doc/goodsList", params, extra);

// 获取服务/作品详情
export let infoService = (params) =>
  request.get("/doc/shop/goodContent", params);

// 获取服务/作品的评价列表
export let listRateByService = (params) =>
  request.get("/doc/shop/goodComment", params, extra);

// 立即雇佣
export let employ = (params) => request.post("/doc/user/createEmploy", params);

// 发布服务
export let createService = (params) =>
  request.post("/doc/service/create", params);

// 购买作品
export let buyGoods = (params) => request.get("/doc/user/buyGoods", params);

// ---- 店铺相关接口 ----

// 获取店铺/个人服务商列表
export let listServicer = (params) =>
  request.get("/doc/service_list", params, extra);

// 获取店铺详情
export let infoShop = (params) => request.get("/doc/shop/shopDetail", params);

// 收藏店铺
export let collect = (params) => request.post("/doc/shop/collect", params);

// 取消收藏店铺
export let uncollect = (params) =>
  request.post("/doc/shop/cancelCollect", params);

// 获取店铺的服务列表
export let listServiceByShop = (params) =>
  request.get("/doc/shop/serviceList", params, extra);

// ---- 个人服务商相关接口 ----

// 获取个人服务商详情
export let infoServicer = (params) =>
  request.get("/doc/service/detail", params, extra);

// 关注个人服务商
export let focus = (params) => request.post("/doc/service/focus", params);

// 取消关注个人服务商
export let unfocus = (params) =>
  request.post("/doc/service/cancel_focus", params);
